package com.xjrsoft.module.ureport.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xjrsoft.module.base.vo.RptFileManagerVo;
import com.xjrsoft.module.ureport.entity.XjrRptFileInfo;
import com.xjrsoft.module.ureport.mapper.XjrRptFileinfoMapper;
import com.xjrsoft.module.ureport.service.IXjrRptFileInfoService;
import com.xjrsoft.module.ureport.vo.RptFileInfoVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 报表管理 服务实现类
 * </p>
 *
 * @author jobob
 * @since 2020-12-10
 */
@Service
public class XjrRptFileInfoServiceImpl extends ServiceImpl<XjrRptFileinfoMapper, XjrRptFileInfo> implements IXjrRptFileInfoService {

    @Override
    public void buildRptFileInfoTree(List<RptFileManagerVo> detailList, List<RptFileInfoVo> rptFileInfoList) {
        for (RptFileManagerVo rptFileManagerVo : detailList) {
            for (RptFileInfoVo rptFileInfoVo : rptFileInfoList) {
                if (StringUtils.equalsIgnoreCase(rptFileManagerVo.getItemValue(), rptFileInfoVo.getType())) {
                    rptFileManagerVo.getChildren().add(rptFileInfoVo);
                }
            }
        }
    }
}
